package aloyii.demo3.after;

/**
 * @Author yajing zhu
 * @Date 2024/10/25 16:09
 * @Version 1.0
 * @注释： 计算机
 */
public class Computer {
    private HardDisk hardDisk;
    private Cpu cpu;
    private Memory memory;
    
    public HardDisk getHardDisk() {
        return hardDisk;
    }
    
    public void setHardDisk(HardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }
    
    public Cpu getCpu() {
        return cpu;
    }
    
    public void setCpu(Cpu cpu) {
        this.cpu = cpu;
    }
    
    public Memory getMemory() {
        return memory;
    }
    
    public void setMemory(Memory memory) {
        this.memory = memory;
    }
    
    //运行计算机
    public void run() {
        System.out.println("运行计算机");
        String data = hardDisk.get();
        System.out.println("从硬盘中取出数据:" + data);
        cpu.run();
        memory.save();
    }
}
